<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <div id="app">

    <input type="text" v-global>
    <input type="text" v-myinput>
  </div>

  <div id="app2">

    <input type="text" v-global>
  </div>
  <script src="./vue.js"></script>
  <script>

    Vue.directive('global', {
        inserted: function(el){
       el.style.color = 'gold'
    }
    })

    var vm = new Vue({
      el:'#app',
      data:{
      },
      methods:{
      },
      directives:{
          myinput: {
              inserted: function(el) {
                  el.style.backgroundColor = 'red'
              }
          }
      }
     });

     new Vue({
         el:"#app2",
         data:{

         }
     })
  </script>
</body>
</html>
